package com.liao.work.ui.activity;

import android.os.Bundle;
import android.widget.GridView;

import androidx.appcompat.app.AppCompatActivity;

import com.liao.work.AdapterPhotoItemAdapter;
import com.liao.work.R;
import com.liao.work.util.ImageUrls;
import com.liao.work.util.SetActionBarTitle;

import java.util.ArrayList;
import java.util.Arrays;

public class PhotosActivity extends AppCompatActivity {

    private GridView gridView;
    private ArrayList<String> urls;
    private AdapterPhotoItemAdapter adapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_photos);
        initView();
        SetActionBarTitle.setTitle(getSupportActionBar(), false, "照片墙");
    }

    private void initView() {
        gridView = (GridView) findViewById(R.id.gridView);

        urls = new ArrayList<>();
        String[] images = ImageUrls.imageurls;
        urls.addAll(Arrays.asList(images));
        adapter = new AdapterPhotoItemAdapter(this, urls);
        gridView.setAdapter(adapter);
    }
}
